﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TinyERP.Core.DTO;
using TinyERP.Core.View.Controls;
using TinyERP.Core.View;
using System.Windows.Forms;

namespace TinyERP.Core
{
    public class Session
    {
        public static IList<UINodeDTO> ApplicationNodes { get; set; }
        public static UserDTO LoginUser { get; set; }
        public static void Logout()
        {
            LoginUser = null;
            UIManager.GetInstance().ContentPanel.CloseAllPanes();
            LoginForm loginForm = new LoginForm();
            DialogResult result = loginForm.ShowDialog();
            if (result != DialogResult.OK)
            {
                Application.Exit();
            }
            else
            {
                UIManager.GetInstance().ReloadNavigator();
            }
        }
    }
}
